package com.itheima.pay.controller;

import com.itheima.pay.dto.Result;
import com.itheima.pay.service.WxPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/pay")
public class PayController {

    @Autowired
    WxPayService wxPayService;

    /**
     * 创建支付二维码
     */
    @GetMapping("/native")
    public <T> Result<T> createNative(@RequestParam Map<String,String> parameterMap) {
        //Map<String, String> result = wxPayService.createNative(parameterMap);
        Map<String, String> resultShaXiang = wxPayService.shaxiang();
        return new Result<>(true, 200, "创建二维码成功",resultShaXiang);
    }
}
